<div class="problemindexholder" problemindex="B">
 <div class="ttypography">
  <div class="problem-statement">
   <div class="header">
    <div class="title">
     B. Japanese Crosswords Strike Back
    </div>
    <div class="time-limit">
     <div class="property-title">
      time limit per test
     </div>
     1 second
    </div>
    <div class="memory-limit">
     <div class="property-title">
      memory limit per test
     </div>
     256 megabytes
    </div>
    <div class="input-file">
     <div class="property-title">
      input
     </div>
     standard input
    </div>
    <div class="output-file">
     <div class="property-title">
      output
     </div>
     standard output
    </div>
   </div>
   <div>
    <p>
     A one-dimensional Japanese crossword can be represented as a binary string of length
     <span class="tex-span">
      <i>
       x
      </i>
     </span>
     . An encoding of this crossword is an array
     <span class="tex-span">
      <i>
       a
      </i>
     </span>
     of size
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     , where
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     is the number of segments formed completely of
     <span class="tex-span">
      1
     </span>
     's, and
     <span class="tex-span">
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
     </span>
     is the length of
     <span class="tex-span">
      <i>
       i
      </i>
     </span>
     -th segment. No two segments touch or intersect.
    </p>
    <p>
     For example:
    </p>
    <ul>
     <li>
      If
      <span class="tex-span">
       <i>
        x
       </i>
       = 6
      </span>
      and the crossword is
      <span class="tex-span">
       111011
      </span>
      , then its encoding is an array
      <span class="tex-span">
       {3, 2}
      </span>
      ;
     </li>
     <li>
      If
      <span class="tex-span">
       <i>
        x
       </i>
       = 8
      </span>
      and the crossword is
      <span class="tex-span">
       01101010
      </span>
      , then its encoding is an array
      <span class="tex-span">
       {2, 1, 1}
      </span>
      ;
     </li>
     <li>
      If
      <span class="tex-span">
       <i>
        x
       </i>
       = 5
      </span>
      and the crossword is
      <span class="tex-span">
       11111
      </span>
      , then its encoding is an array
      <span class="tex-span">
       {5}
      </span>
      ;
     </li>
     <li>
      If
      <span class="tex-span">
       <i>
        x
       </i>
       = 5
      </span>
      and the crossword is
      <span class="tex-span">
       00000
      </span>
      , then its encoding is an empty array.
     </li>
    </ul>
    <p>
     Mishka wants to create a new one-dimensional Japanese crossword. He has already picked the length and the encoding for this crossword. And now he needs to check if there is
     <span class="tex-font-style-bf">
      exactly one
     </span>
     crossword such that its length and encoding are equal to the length and encoding he picked. Help him to check it!
    </p>
   </div>
   <div class="input-specification">
    <div class="section-title">
     Input
    </div>
    <p>
     The first line contains two integer numbers
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     and
     <span class="tex-span">
      <i>
       x
      </i>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       n
      </i>
      ≤ 100000
     </span>
     ,
     <span class="tex-span">
      1 ≤
      <i>
       x
      </i>
      ≤ 10
      <sup class="upper-index">
       9
      </sup>
     </span>
     ) — the number of elements in the encoding and the length of the crossword Mishka picked.
    </p>
    <p>
     The second line contains
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     integer numbers
     <span class="tex-span">
      <i>
       a
      </i>
      <sub class="lower-index">
       1
      </sub>
     </span>
     ,
     <span class="tex-span">
      <i>
       a
      </i>
      <sub class="lower-index">
       2
      </sub>
     </span>
     , ...,
     <span class="tex-span">
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        n
       </i>
      </sub>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
      ≤ 10000
     </span>
     ) — the encoding.
    </p>
   </div>
   <div class="output-specification">
    <div class="section-title">
     Output
    </div>
    <p>
     Print
     <span class="tex-font-style-tt">
      YES
     </span>
     if there exists
     <span class="tex-font-style-bf">
      exaclty one
     </span>
     crossword with chosen length and encoding. Otherwise, print
     <span class="tex-font-style-tt">
      NO
     </span>
     .
    </p>
   </div>
   <div class="sample-tests">
    <div class="section-title">
     Examples
    </div>
    <div class="sample-test">
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>2 4<br/>1 3<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>NO<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>3 10<br/>3 3 2<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>YES<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>2 10<br/>1 3<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>NO<br/></pre>
     </div>
    </div>
   </div>
  </div>
  <p>
  </p>
 </div>
</div>
